package com.dyh.quickdemozwei.withdraw;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @Author: yhdong
 * @Date: 2021/11/30 16:15
 */
@Getter@Setter
public class ActionWrap<P> {
    Action<P> action;
    Action<P> deAction;

    public static <P> ActionWrap<P> from(Action<P> action){
        ActionWrap<P> actionWrap = new ActionWrap<>();
        actionWrap.setAction(action);
        return actionWrap;
    }

    public static <P> ActionWrap<P> bind(Action<P> action,Action<P> deAction){
        ActionWrap<P> actionWrap = new ActionWrap<>();
        actionWrap.setAction(action);
        actionWrap.setDeAction(deAction);
        return actionWrap;
    }

}
